package com.bawei.park2211a.login

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.bawei.base.SingLeLiveDataEvent
import com.bawei.base.bean.LoginEntity
import com.bawei.base.mvvm.BaseViewModel
import com.bawei.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch
import javax.inject.Inject
@HiltViewModel
class LoginViewModel @Inject constructor(var apiService: ApiService):BaseViewModel() {
    var loginSuccess=SingLeLiveDataEvent<LoginEntity>()
    fun login(username:String,password:String){
            httpRequest({
                apiService.login(username,password)
            },{
                loginSuccess.value=it
            })

    }
}